package Test;

public class Triangle implements Calculability {
    private int length;
    private int high;
    /**
     * 无参数构造器
     * 默认：长5 宽4
     */
    public Triangle(){
        length=5;
        high=4;
    }
    /**
     *
     * @param l 长
     * @param w 宽
     */
    public Triangle(int l,int w){
        this.length=l;
        this.high=w;
    }
    /**
     * FOR TEST
     * @param args No args
     */
    public static void main(String[] args) {
        Triangle triangle=new Triangle();
        System.out.println("三角形：长："+triangle.getLength()+" 宽: "+triangle.getHigh());
        System.out.println("面积为： "+triangle.area());
    }
    @Override
    public int area(){
        return (length*high)/2;
    }

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public int getHigh() {
        return high;
    }

    public void setHigh(int high) {
        this.high = high;
    }
}
